export default function reducer(
  state = { name: "react-redux", num: 100 },
  action
) {
  switch (action.type) {
    case "add":
      return {
        ...state,
        num: state.num + action.count,
      };

    case "deadd":
      return {
        ...state,
        num: state.num - action.count,
      };

    default:
      return state;
  }
}
